<html>
<head>
    <meta charset="UTF-8">
    <title>简单循环变色</title>
    <script src="js/jquery-1.8.1.min.js"></script>
    <style type="text/css">
        body {
            padding: 0px;
            margin: 0px;
        }

        #child1 {
            height: 28px;
            background-color: red;
        }

        #child2 {
            height: 28px;
            background-color: red;
        }

        #child3 {
            height: 28px;
            background-color: red;
        }

        ul {
            padding: 0px;
            margin: 0px;
            list-style: none;
        }

        ul li {
            width: 732px;
            margin-top: 10px;
            background-color: #2f3238;
        }

        ul .name {
            text-align: center;
            background-color: red;
            float: left;
            width: 100px;
            height: 28px;
            line-height: 28px;
            vertical-align: middle;
        }

        ul .parent {
            float: right;
            width: 600px;
            height: 28px;
        }

        ul .parent div {
            float: left;
        }

        ul li span {
            float: left;
        }
    </style>
    <script type="text/javascript">
        function init() {
            var pro = 0;
            var pro1 = 0;
            var pro2 = 0;
            var update = setInterval(function () {
                pro++;
                pro1++;
                pro2++;
                $("#child1").width(pro + "%");
                $("#child2").width(pro1 + "%");
                $("#child3").width(pro2 + "%");
                if (pro == 100) {
                    clearInterval(update);
                }
            }, 100);
        }
    </script>
</head>
<body onload="init()">
<ul>
    <li>
        <label class="name">美国3</label>
        <div class="parent">
            <div id="child1"></div>
        </div>
        <div style="clear: both"></div>
    </li>
    <li>
        <label class="name">美国3</label>
        <div class="parent">
            <div id="child2"></div>
        </div>
        <div style="clear: both"></div>
    </li>
    <li>
        <label class="name">美国3</label>
        <div class="parent">
            <div id="child3"></div>
        </div>
        <div style="clear: both"></div>
    </li>
</ul>
</body>
</html>
